﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.DataBase.MyProject.Infrastructure.Interface
{
    /// <summary>
    /// 仓储接口
    /// </summary>
    public interface IBaseRepository<T> where T : class
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public Task<int> Add(T entity);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public Task<int> Update(T entity);

        /// <summary>
        /// 查询所有
        /// </summary>
        /// <returns></returns>
        public Task<IQueryable<T>> GetAll();

        /// <summary>
        ///批量添加
        /// </summary>
        /// <param name="entitys"></param>
        /// <returns></returns>
        public Task<int> AddRanges(List<T> entitys);

        /// <summary>
        /// 批量真删
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public Task<int> DeleteRemove(List<T> entity);      

        /// <summary>
        /// 单真删删
        /// </summary>
        /// <param name="entitys"></param>
        /// <returns></returns>
        public Task<int> Delete(T entitys);

        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="entitys"></param>
        /// <returns></returns>
        public Task<int> UpdateRanhes(List<T> entitys);



    }
}
